﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System.IO;
using System.Collections.Generic;

namespace DNA.Mvc
{
    /// <summary>
    /// Defines a Repository to mainpluate WidgetTemplate objects.
    /// </summary>
    public interface IWidgetTemplateRepository : IRepository<WidgetTemplate>
    {
        /// <summary>
        /// Gets WidgetTemplates with in specified categry
        /// </summary>
        /// <param name="category"></param>
        /// <returns></returns>
        IEnumerable<WidgetTemplate> WithIn(string category);

        /// <summary>
        /// Gets WidgetTemplates with in specified categry
        /// </summary>
        /// <param name="category"></param>
        /// <param name="total"></param>
        /// <param name="index"></param>
        /// <param name="size"></param>
        /// <returns></returns>
        IEnumerable<WidgetTemplate> WithIn(string category, out int total, int index = 0, int size = 50);

        /// <summary>
        /// Get category names.
        /// </summary>
        /// <returns></returns>
        string[] GetCategories();

        /// <summary>
        /// Create new category
        /// </summary>
        /// <param name="category">Specified the category name.</param>
        void AddCategory(string category);

        /// <summary>
        /// Delete the category
        /// </summary>
        /// <param name="category">Specified the category name.</param>
        /// <returns></returns>
        bool DeleteCategory(string category);

        /// <summary>
        /// Delete the WidgetTemplate by ID
        /// </summary>
        /// <param name="id">Specified the WidgetTemplate id.</param>
        /// <returns>Returns true when success</returns>
        bool Delete(string id);

        /// <summary>
        /// Gets whether the WidgetTemplate is exists by specified id.
        /// </summary>
        /// <param name="id">Specified the WidgetTemplate id.</param>
        /// <returns>Returns true whether exists.</returns>
        bool Contains(string id);

       // void WriteTo(Stream output);
    }
}
